GXPD 01 - GX 'comm' Resource Type
Title Banner


Technical Q&A's


GXPD 01 - GX 'comm' Resource Type (1-May-95)


Q We have a printer that can be connected through a serial or a parallel interface. We provide an entry in our 'look' resource which references a special "parallel" 'comm' resource to provide the "parallel" option in the Chooser menu. The communication type we specify in the 'comm' resource is 'PARA'. How can we create a 'PARA' comm resource to be stored in our desktop printer?

A There are two ways you can accomplish this:

1. Redefine the 'comm' resource type to include your special connection type in addition to the standard ones (SPTL, PPTL, etc.). It is necessary to redefine the type, because otherwise, you won't be able to successfully Rez your code, since you're specifying a comm type that the interfaces don't describe. When the corresponding menu item is selected, QuickDraw GX automatically copies your 'look' into the desktop printer that's created. If you need to tweak the data being written to the desktop printer, override GXDefaultDesktopPrinter and modify the resource (see number 2).

2. Create your 'comm' resource as a 'nops comm' resource. While nops comm resources are intended for non-connected printers, you can modify the resource as it's being written out, since the comm resource is only used after copying it to the desktop printer. To do this, override GXDefaultDesktopPrinter, forward the message, call GXFetchDTPData to load the comm resource, modify the data (change it to a 'PARA' comm resource), and write it back out by calling GXWriteDTPData.

Your 'look' and 'iobm' resources don't require any changes, except to have the look resource reference the appropriate comm resources. You'll have to override GXOpenConnection, GXCloseConnection, GXDumpBuffer, and so on, since you're specifying an unknown communication protocol (you need to implement that communication mechanism).

Technical Support
Technical Q&As
Contents | Next Question

Navigation graphic, see text links

Main | Page One | What's New | Apple Computer, Inc. | Find It | Contact Us | Help